import { View, Text } from 'react-native'
import React, { useState } from 'react'
import AdminLogin from "./screens/AdminLogin";
import MainMenu from './screens/MainMenu'
import ProduceDetails from './screens/ProduceDetails'
import ProductList from './screens/ProductList'
import { NavigationContainer } from '@react-navigation/native';
import { createNativeStackNavigator } from '@react-navigation/native-stack';
const {Navigator,Screen}=createNativeStackNavigator()

export default function App() {

  return (
    <NavigationContainer>
      <Navigator initialRouteName='login'>
        <Screen 
        name='admin' component={AdminLogin} 
        options={{
            title:'管理员登陆页面',
            headerStyle:{
              backgroundColor:'#0aa1ed'
            },
            headerTintColor:'#fff',
            headerTitleStyle:{fontWeight:'bold'}
        }}/>
        <Screen 
        name='menu' component={MainMenu}
        options={{
          title:'主菜单',
          headerStyle:{
            backgroundColor:'#0aa1ed'
          },
          headerTintColor:'#fff',
          headerTitleStyle:{
            fontWeight:'bold'
          }
        }}/>
        <Screen name='plist' component={ProductList} 
        options={{
          headerStyle:{
            backgroundColor:'#0aa1ed'
          },
          headerTintColor:'#fff',
          headerBackTitleStyle:{
            fontWeight:'bold'
          }
        }}/>
        <Screen 
        name='pdetails' component={ProduceDetails}
        options={{
          headerStyle:{
            backgroundColor:'#0aa1ed'
          },
          headerTintColor:'#fff',
          headerBackTitleStyle:{
            fontWeight:'bold'
          }
        }}/>
      </Navigator>
    </NavigationContainer>
  )
}